<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <div id="box">
        {{msg | parseTime}}
    </div>




    <script>
        var d = new Date();
        console.log(d);
        Vue.filter("parseTime", (val) => {
            var date = new Date(Number(val))
            console.log(date);
            var y = date.getFullYear();
            var m = date.getMonth();
            var d = date.getDate();
            var h = date.getHours();
            var f = date.getMinutes();
            var s = date.getSeconds();
            return y + "年" + m + "月" + d + "日 " + h + "时" + f + "分" + s + "秒"

        })
        var vm = new Vue({
            el: "#box",
            data: {
                msg: "1632995735577"
            }
        })
    </script>
</body>

</html>